package models;

import play.*;
import play.db.jpa.*;

import javax.persistence.*;
import java.util.*;

@Entity
public class Tag extends Model {
    
	public String tag;
	
	public Tag(String _tag) {
		this.tag = _tag;
	}

	public static Tag findOrCreate(String _tag){
		Tag tag = Tag.find("tag = ?", _tag).first();
		
		if(null==tag)
			return new Tag(_tag);
		
		return tag;
	}
	
}
